<template>
    <div id="background">
        <el-container>
            <el-header id="xiaoXiDetailHead">
                <el-row type="flex" style="height:80%;display:flex;align-items: flex-end">
                    <el-col :xs="2" :sm="2" :md="2" :offset="1"  class="imgCol">
                        <img v-bind:src="backIcon" class="backSize" @click="back"/>
                    </el-col>
                    <el-col  :xs="6" :sm="6" :md="6" :offset="6" class="imgCol"> 
                        <span class="titleSize" >消息详情</span>
                    </el-col>
                </el-row>
            </el-header>
            <el-main>
                <el-card class="xiaoXiCard" @click="goToXiaoXiDetail(xiaoXi.id)" style="margin-top:10px">
                    <div class="imgCol">
                        <span>{{title}}</span>
                    </div>
                    <div>
                        <el-row style="margin-top:5px">
                            <el-col :xs="9" :sm="9" :md="9" :offset="0">
                                <span class="words" style="font-size:14px">培训班名称</span>
                            </el-col>
                            <el-col :xs="15" :sm="15" :md="15" :offset="0">
                                <span class="words" style="font-size:14px">{{xiaoXiContain.consignName}}</span>
                            </el-col>
                        </el-row>
                    </div>
                     <div>
                        <el-row style="margin-top:5px">
                            <el-col :xs="9" :sm="9" :md="9" :offset="0">
                                <span class="words" style="font-size:14px">报名状态</span>
                            </el-col>
                            <el-col :xs="15" :sm="15" :md="15" :offset="0">
                                <span class="words" style="font-size:14px">{{xiaoXiContain.applyState}}</span>
                            </el-col>
                        </el-row>
                    </div>
                     <div>
                        <el-row style="margin-top:5px">
                            <el-col :xs="9" :sm="9" :md="9" :offset="0">
                                <span class="words" style="font-size:14px">支付金额</span>
                            </el-col>
                            <el-col :xs="15" :sm="15" :md="15" :offset="0">
                                <span class="words" style="font-size:14px">{{xiaoXiContain.fee}}</span>
                            </el-col>
                        </el-row>
                    </div>
                     <div>
                        <el-row style="margin-top:5px">
                            <el-col :xs="9" :sm="9" :md="9" :offset="0">
                                <span class="words" style="font-size:14px">支付时间</span>
                            </el-col>
                            <el-col :xs="15" :sm="15" :md="15" :offset="0">
                                <span class="words" style="font-size:14px">{{xiaoXiContain.datetime}}</span>
                            </el-col>
                        </el-row>
                    </div>
                     <div>
                        <el-row style="margin-top:5px">
                            <el-col :xs="9" :sm="9" :md="9" :offset="0">
                                <span class="words" style="font-size:14px">注意事项</span>
                            </el-col>
                            <el-col :xs="15" :sm="15" :md="15" :offset="0">
                                <span class="words" style="font-size:14px">{{xiaoXiContain.announcements}}</span>
                            </el-col>
                        </el-row>
                    </div>
                     <div>
                        <el-row style="margin-top:5px">
                            <el-col :xs="9" :sm="9" :md="9" :offset="0">
                                <span class="words" style="font-size:14px">如有疑问</span>
                            </el-col>
                            <el-col :xs="15" :sm="15" :md="15" :offset="0">
                                <span class="words" style="font-size:14px">{{xiaoXiContain.question}}</span>
                            </el-col>
                        </el-row>
                    </div>
                </el-card>
            </el-main>
        </el-container>
    </div>
</template>
<script>
import backIcon from '../../assets/img/mine/geRenZhongXin/back.png'
export default {
    data(){
        return{
            //绑定该条消息的地址
            url:'',
            backIcon:backIcon,
            title:'',
            xiaoXiTitle:['培训班名称','报名状态','支付金额','支付时间','注意事项','如有疑问'],
            xiaoXiContain:'',
        }
    },
    mounted(){
            this.url=this.$route.query.url;
            this.title=this.$route.query.title;
            console.log(this.url);
            console.log(this.title);
            this.getXiaoXiDetail(this.url);

            var normalHeight=document.documentElement.clientHeight;

            var head=document.getElementById("xiaoXiDetailHead");
            var headHeight=normalHeight/30 *4 ;
            console.log("headHeight:"+headHeight);
            head.style.height=headHeight+"px";
    },
    methods:{
        back(){
            console.log("back:");
            this.$router.go(-1);
        },
        //通过url请求具体消息
        getXiaoXiDetail(url){
            var URL=url;
            console.log(URL);
            this.$ajax({
                method:'get',
                url:URL,
            }).then(response=>{
                console.log(response.data);
                var code=response.data.code;
                if(code==0){
                    this.xiaoXiContain=response.data.data;
                }else{
                    Toast(response.data.msg);
                }
            }).catch(error=>{
                console.log(error);
                //Toast(error);
            })
        }
    }
}
</script>
<style>
.xiaoXiCard{
    margin:5px 20px 20px 20px;
}
.imgCol{
    display:flex;
    align-items:center;
    justify-content:center
}
.words{
    color:#707070;
}
.el-main {
    padding: 0px ;
}
.el-header{
  padding:0px;
}
.el-footer {
    padding:0px;
}
#xiaoXiDetailHead{
    background-color: #53cdf5;
}
.backSize{
    height: 26px;
}
.titleSize{
    font-size:1.125em;
    color:#ffffff
}
@media screen and (max-width: 340px){
  .backSize{
      height: 22px;
  }
  .titleSize{
      font-size: 1em;
  }
}
</style>
